﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="sms_money_data.aspx.vb" Inherits="webfinancegdrassign4.sms_money_data" %>

       
 <%--Smart Money $aver Project for University of Herts--%>
 <%--Date: 01 December 2013--%>   
 <%--Version 1--%>
 <%--Project Brief Description - This is a Smart Money Saver asp.net product using VB.net. It is intended to be used by Smart Money Savers who want to make and save money and earn and save a certain amount to benefit--%>
 <%--Program Brief Description - This is the main Site.Master file. All change appear on all pages. This is a standard program from a default build from setting up the project in Visual Studio --%>
 <%--Changes - Added an image for the Smart Investor program / website --%>
 <%--Changes - Changed original Texts to 'Smart Money $aver ' --%>

 <%--Update 1 -  5th Jan 2014 - sms_info_contact_info.aspx enabled page to allow admin user to update,delete and select data from Table --%>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

        <hgroup></hgroup>
        <h1><br /></h1> 
        <h1>Edit Money Information</h1> 

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource005" DataKeyNames="ID" AllowPaging="True" AllowSorting="True" CellPadding="4" style="font-size: xx-small" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" InsertVisible="False" ReadOnly="True"  />
            <asp:BoundField DataField="moneytype_fkid" HeaderText="moneytype_fkid" SortExpression="moneytype_fkid" />
            <asp:BoundField DataField="moneysubtype_fkid" HeaderText="moneysubtype_fkid" SortExpression="moneysubtype_fkid" />
            <asp:BoundField DataField="Company_Name" HeaderText="Company_Name" SortExpression="Company_Name" />
            <asp:BoundField DataField="Stars" HeaderText="Stars" SortExpression="Stars" />
            <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
            <asp:BoundField DataField="ContactDetails" HeaderText="ContactDetails" SortExpression="ContactDetails" />
            <asp:BoundField DataField="companyurl" HeaderText="companyurl" SortExpression="companyurl" />
            <asp:BoundField DataField="Picture" HeaderText="Picture" SortExpression="Picture" />
        
        </Columns>



        <EditRowStyle BackColor="#2461BF" />



        <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />



    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource005" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString006 %>" ProviderName="<%$ ConnectionStrings:ConnectionString006.ProviderName %>" SelectCommand="SELECT [ID], [moneytype_fkid], [moneysubtype_fkid], [Company Name] AS Company_Name, [Stars], [Description], [ContactDetails], [companyurl], [Picture] FROM [sms_moneydata]" OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues" InsertCommand="INSERT INTO [sms_moneydata] ([ID], [moneytype_fkid], [moneysubtype_fkid], [Company Name], [Stars], [Description], [ContactDetails], [companyurl], [Picture]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)" DeleteCommand="DELETE FROM [sms_moneydata] WHERE [ID] = ? AND (([moneytype_fkid] = ?) OR ([moneytype_fkid] IS NULL AND ? IS NULL)) AND (([moneysubtype_fkid] = ?) OR ([moneysubtype_fkid] IS NULL AND ? IS NULL)) AND (([Company Name] = ?) OR ([Company Name] IS NULL AND ? IS NULL)) AND (([Stars] = ?) OR ([Stars] IS NULL AND ? IS NULL)) AND (([Description] = ?) OR ([Description] IS NULL AND ? IS NULL)) AND (([ContactDetails] = ?) OR ([ContactDetails] IS NULL AND ? IS NULL)) AND (([companyurl] = ?) OR ([companyurl] IS NULL AND ? IS NULL)) AND (([Picture] = ?) OR ([Picture] IS NULL AND ? IS NULL))" UpdateCommand="UPDATE [sms_moneydata] SET [moneytype_fkid] = ?, [moneysubtype_fkid] = ?, [Company Name] = ?, [Stars] = ?, [Description] = ?, [ContactDetails] = ?, [companyurl] = ?, [Picture] = ? WHERE [ID] = ? AND (([moneytype_fkid] = ?) OR ([moneytype_fkid] IS NULL AND ? IS NULL)) AND (([moneysubtype_fkid] = ?) OR ([moneysubtype_fkid] IS NULL AND ? IS NULL)) AND (([Company Name] = ?) OR ([Company Name] IS NULL AND ? IS NULL)) AND (([Stars] = ?) OR ([Stars] IS NULL AND ? IS NULL)) AND (([Description] = ?) OR ([Description] IS NULL AND ? IS NULL)) AND (([ContactDetails] = ?) OR ([ContactDetails] IS NULL AND ? IS NULL)) AND (([companyurl] = ?) OR ([companyurl] IS NULL AND ? IS NULL)) AND (([Picture] = ?) OR ([Picture] IS NULL AND ? IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="original_ID" Type="Int32" />
            <asp:Parameter Name="original_moneytype_fkid" Type="Int32" />
            <asp:Parameter Name="original_moneytype_fkid" Type="Int32" />
            <asp:Parameter Name="original_moneysubtype_fkid" Type="Int32" />
            <asp:Parameter Name="original_moneysubtype_fkid" Type="Int32" />
            <asp:Parameter Name="original_Company_Name" Type="String" />
            <asp:Parameter Name="original_Company_Name" Type="String" />
            <asp:Parameter Name="original_Stars" Type="Int32" />
            <asp:Parameter Name="original_Stars" Type="Int32" />
            <asp:Parameter Name="original_Description" Type="String" />
            <asp:Parameter Name="original_Description" Type="String" />
            <asp:Parameter Name="original_ContactDetails" Type="String" />
            <asp:Parameter Name="original_ContactDetails" Type="String" />
            <asp:Parameter Name="original_companyurl" Type="String" />
            <asp:Parameter Name="original_companyurl" Type="String" />
            <asp:Parameter Name="original_Picture" Type="String" />
            <asp:Parameter Name="original_Picture" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ID" Type="Int32" />
            <asp:Parameter Name="moneytype_fkid" Type="Int32" />
            <asp:Parameter Name="moneysubtype_fkid" Type="Int32" />
            <asp:Parameter Name="Company_Name" Type="String" />
            <asp:Parameter Name="Stars" Type="Int32" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="ContactDetails" Type="String" />
            <asp:Parameter Name="companyurl" Type="String" />
            <asp:Parameter Name="Picture" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="moneytype_fkid" Type="Int32" />
            <asp:Parameter Name="moneysubtype_fkid" Type="Int32" />
            <asp:Parameter Name="Company_Name" Type="String" />
            <asp:Parameter Name="Stars" Type="Int32" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="ContactDetails" Type="String" />
            <asp:Parameter Name="companyurl" Type="String" />
            <asp:Parameter Name="Picture" Type="String" />
            <asp:Parameter Name="original_ID" Type="Int32" />
            <asp:Parameter Name="original_moneytype_fkid" Type="Int32" />
            <asp:Parameter Name="original_moneytype_fkid" Type="Int32" />
            <asp:Parameter Name="original_moneysubtype_fkid" Type="Int32" />
            <asp:Parameter Name="original_moneysubtype_fkid" Type="Int32" />
            <asp:Parameter Name="original_Company_Name" Type="String" />
            <asp:Parameter Name="original_Company_Name" Type="String" />
            <asp:Parameter Name="original_Stars" Type="Int32" />
            <asp:Parameter Name="original_Stars" Type="Int32" />
            <asp:Parameter Name="original_Description" Type="String" />
            <asp:Parameter Name="original_Description" Type="String" />
            <asp:Parameter Name="original_ContactDetails" Type="String" />
            <asp:Parameter Name="original_ContactDetails" Type="String" />
            <asp:Parameter Name="original_companyurl" Type="String" />
            <asp:Parameter Name="original_companyurl" Type="String" />
            <asp:Parameter Name="original_Picture" Type="String" />
            <asp:Parameter Name="original_Picture" Type="String" />
        </UpdateParameters>
        </asp:SqlDataSource>
        <br />
        <br />
        <h1>Add a New Record </h1>
        <br style="font-size: small" />
        <br style="font-size: small" />
        <table style="width: 100%; background-color: #507CD1">
            <tr>
                <td style="width: 270px; height: 56px">Money Type Id<span style="font-size: small">&nbsp;&nbsp;&nbsp; :</span><asp:SqlDataSource ID="SqlDataSource007" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString07 %>" ProviderName="<%$ ConnectionStrings:ConnectionString07.ProviderName %>" SelectCommand="SELECT [ID], [moneytype] FROM [sms_moneytype]"></asp:SqlDataSource>
                </td>
                <td style="width: 835px; height: 56px"><asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource007" DataTextField="moneytype" DataValueField="moneytype" Width="80px">
</asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td style="width: 270px">
        <br style="font-size: small" />
        Money Sub Type<span style="font-size: small"> :</span></td>
                <td style="width: 835px"><asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource08" DataTextField="moneysubtype_name" DataValueField="moneysubtype_name">
</asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSource08" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString004 %>" ProviderName="<%$ ConnectionStrings:ConnectionString004.ProviderName %>" SelectCommand="SELECT [moneysubtype_name], [sms_moneytype_fkid] FROM [sms_moneysubtype]"></asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td style="width: 270px">Company N<span style="font-size: small">ame:</span></td>
                <td style="width: 835px"><span style="font-size: small"><asp:TextBox ID="company_name" runat="server" Width="456px"></asp:TextBox>
        </span>
                </td>
            </tr>
            <tr>
                <td style="width: 270px; height: 40px;">
                    <span style="font-size: small">Location:</span></td>
                <td style="width: 835px; height: 40px;"> <span style="font-size: small"><asp:TextBox ID="location" runat="server" Width="456px"></asp:TextBox>
        </span>
                </td>
            </tr>
            <tr>
                <td style="width: 270px; height: 40px;">
                    Stars:</td>
                <td style="width: 835px; height: 40px;"> 
                    <asp:RadioButton ID="RadioButton1" runat="server" />
                    <asp:RadioButton ID="RadioButton2" runat="server" />
                    <asp:RadioButton ID="RadioButton3" runat="server" />
                    <asp:RadioButton ID="RadioButton4" runat="server" />
                    <asp:RadioButton ID="RadioButton5" runat="server" />
                </td>
            </tr>
            <tr>
                <td style="width: 270px; height: 40px;">
        <br style="font-size: small" />
                    Description:&nbsp;&nbsp;</td>
                <td style="width: 835px; height: 40px;"> <span style="font-size: small"><asp:TextBox ID="description" runat="server" Width="456px"></asp:TextBox>
        </span>
                </td>
            </tr>
            <tr>
                <td style="width: 270px">Contact
        <span style="font-size: small">Details&nbsp;&nbsp; :</span></td>
                <td style="width: 835px"><span style="font-size: small"><asp:TextBox ID="contact_details" runat="server" Width="455px"></asp:TextBox>
        </span>
                </td>
            </tr>
            <tr>
                <td style="width: 270px">Company URL <span style="font-size: small">&nbsp; :</span></td>
                <td style="width: 835px"><span style="font-size: small"><asp:TextBox ID="company_url" runat="server" Width="454px"></asp:TextBox>
        </span>
                </td>
            </tr>
            <tr>
                <td style="width: 270px"><span style="font-size: small">Picture&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; :</span></td>
                <td style="width: 835px">
                    <asp:FileUpload ID="FileUpload1" runat="server" />
                </td>
            </tr>
        </table>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br style="font-size: small" />
        <br style="font-size: small" />
        <br style="font-size: small" />
        <br style="font-size: small" />
        <span style="font-size: small">
        <br />
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Height="36px" Text="Save New Record" Width="150px" />
        &nbsp;
        <asp:Label ID="labelrecord" runat="server"></asp:Label>
        <br />
        <asp:Button ID="Button2" runat="server" Height="36px" Text="Return to Main Menu" Width="150px" PostBackUrl="~/Account/Admininput.aspx" />
        <br />
        </span>
        <br />



</asp:Content>
